'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: tool_entities.py
* @Time: 2025/11/10
* @All Rights Reserve By Brtc
'''
from enum import Enum
from typing import Optional, Any
from pydantic import BaseModel, Field


class ToolParamType(str, Enum):
    """工具参数的枚举类"""
    STRING = "string"
    NUMBER = "number"
    BOOLEAN = "boolean"
    SELECT = "select"


class ToolParam(BaseModel):
    name:str# 参数名称 如  city
    label:str#参数实际展示的标签
    type:ToolParamType #参数的类型
    required:bool = False # 参数是否必填
    default:Optional[Any] = None # 默认值
    min:Optional[Any] = None # 最小值
    max: Optional[Any] = None  # 最小值
    options:list[dict[str, Any]] = Field(default_factory=list) # 下拉菜单选项


class ToolEntity(BaseModel):
    """工具实体类"""
    name:str #名称
    label:str #标签
    description:str #工具描述
    params:list[ToolParam] = Field(default_factory=list)